<include file="public:header" />


<div class="container">
    <br />
    <br />
    <h2>库存录入</h2>
    <br />
    <form id="formBox" role="form" action="index.php?g=api&m=inventory&a=set" method="post">
        
        <input type="hidden" value="5" name="storeId" />
        <input type="hidden" value="10013" name="microAreaId" />
        
        
        <div class="form-group">
          <label for="brand1">品牌1</label>
          <input type="text" name="brandId[]" class="form-control" id="brand1">
        </div>
        <div class="form-group">
          <label for="model1">机型1</label>
          <input type="text" name="modelId[]" class="form-control" id="model1">
        </div>
        <div class="form-group">
          <label for="num1">数量1</label>
          <input type="text" name="num[]" class="form-control" id="num1">
        </div>
        
        <div class="form-group">
          <label for="brand2">品牌2</label>
          <input type="text" name="brandId[]" class="form-control" id="brand2">
        </div>
        <div class="form-group">
          <label for="model2">机型2</label>
          <input type="text" name="modelId[]" class="form-control" id="model2">
        </div>
        <div class="form-group">
          <label for="num2">数量2</label>
          <input type="text" name="num[]" class="form-control" id="num2">
        </div>

        <button type="submit" class="btn btn-default">Submit</button>
     </form>
</div>



<script type="text/javascript">
$(document).ready(function(){
    //绑定一个指定的表单
    $('#formBox').ajaxForm({ 
            //设置传输的数据类型
            dataType:  'json', 
            //请求成功后，调用的回调函数
            success:  back
    }); 
    
    //绑定一个指定的表单
    $('#formBoxVisit').ajaxForm({ 
            //设置传输的数据类型
            dataType:  'json', 
            //请求成功后，调用的回调函数
            success:  back
    }); 
    

    function back(data){
        if(data.status === 200){
            alert(data.msg);
            console.log(data.data);
        }else{
           alert(data.msg);
        }
    }
});


</script>

<include file="public:footer" />